Copyright: Copyright ©1987 Borland International


Contents

How Do Web Applications Work?

What Are The Visual dBASE 7 Web Wizards?

The Data-Entry Wizard

The Query And Response Wizard

The Publish Wizard

Reports

Data Modules and Queries

URLs - Launching Your Application

Images

System Requirements


Data Modules and Queries

Paths

The Visual dBASE 7 Data-Entry Web Wizards are based on data modules and tables. If you use a table as a datasource, the Wizard creates its own query to open and update the table.  The Visual dBASE 7 Query and Response and Publish Wizards are based on reports (.rep files), which contain Query objects or Data Modules.

If you specify a Data Module or your report employs a Data Module, the Web Wizards will compile and build them in their original folders. However, they'll be run by your Web Server from within the CGI-BinI folder.A Data Module or SQL Select statement without explicit paths may crash your Web application.

If you're using a free-standing table as a datasource for your Web application, make sure you include the full path to the table when you select it in the Web Wizard.

Limitations

The current version of the Web Wizards does not support subclassed Data Modules  - Data Modules which are inherited from other data modules.


How Web Applications Work
How Do Web Applications Work?

What is a Web Application?

Until recently, most Web sites consist of static HTML pages - pre-designed, unchanging pages that are essentially read-only in the Browser. Today, many sites (and intranets)  pack much more power, providing interactive queries, data gathering and order-entry with the Browser as client software. These interactive pages are Web applications.

Web applications consist of both client-side and server-side operations.

Client-side operations are operations that occur on the Browser.

Server-side operations are operations that occur on the Web Server.

Web applications perform operations on the Server in response to data or instructions received from the Browser.

What is HTML?

HTML is a simple page-description language (PDL) used to format Web pages. As Browsers become more powerful, so does HTML, acquiring new capabilities such as forms, frames, and layers. The "Interpreter" for HTML is built right into the Browser.

Tip: Each Browser's implemenation of HTML can be very different. Be careful to view HTML pages in both Internet Explorer and Netscape Navigator before deploying into an environment in which you don't control which browser is used (such as the WWW). The appearance of pages can vary dramatically depending on the browser.

Some Web applications (like those created using the Data-Entry and Query Wizards) start with an HTML page that sends data back to the server  The Browser knows  to bring back user-entered information  because you've defined a form within your HTML page.

Forms

A form is a section of the HTML page in which data-entry controls can be placed. The form region is created using the <form>...</form> tag. When a page is submitted (using a Submit pushbutton), the data in all the controls between <form> and </form> is sent back to the server for processing.

CGI

When the form's data is received by the Web Server, it's sent to a server-side application using any of of a variety of communication interfaces. The Visual dBASE 7 Web Wizards use CGI-Bin. CGI-Bin communicates the data sent back from the Web page as an environment variable. The response is sent back to the Browser by streaming it out to Stdout (the console).

Win-CGI is automatic and built into your Windows-based (Windows 95/NT) Web Server.

How Does The Server Recognize an Application?

By its address. In your server, you will map a folder for "CGI-Bin". Mapping is the process of assigning a "virtual" folder to an actual folder. Mapping is simple substitution.

Example: If I map the following path:

c:\MyWebSite\DataGathering\OrderEntry

to a new "virtual" folder:

/Orders/

in my Web Server,. every time the server sees "/orders/" it will automatically substitute "c:\MyWebSite\DataGathering\OrderEntry".

Tip: Remember to use slash (/) instead of backslash {\} when defining or address "virtual" folders. Web addresses use the Unix conventions, not the DOS/Windows conventions for folder notation.

When you set up your Web Server, you will identify a "virtual" folder as the CGI-Bin folder. Whenever the Web Server encounters your virtual folder in an address (URL), it will know to execute the file specified in the URL as an application rather than trying to return it as a Web page.

The traditional server mapping for the CGI-Bin folder is either /CGI-Bin/  However, you may use any virtual folder you wish that is mapped and accessible to your Web Server.

Web Application URL

A Web-page URL may look something like this: http://www.borldand.com/vdb.htm

A Web application URL may look something like this: http://www.borland.com/cgi-bin/myapplication.exe

CGI URLs can also take a command-line parameter (used by the Drill-down Query and Response Wizard):

http://www.borland.com/cgi-bin/myapplication.exe?myparam

How Do I Create Complex Applications?

Both CGI and the Visual dBASE 7 Web Wizards are fairly limited in what they do. The Web Wizards are designed to accomplish specific common tasks involving databases. However, you may need to execute much more complex, multi-page, multi-form operations. You have several options for creating more robust Browser-based applications:

You can write your own source code in Visual dBASE 7 or modify the source code generated by the Visual dBASE 7 Web Wizards.

If you need multiple forms or continuous database connections, you may want to use Borland's IntraBuilder to create those applications. Due to the nature of HTTP (Hypertext Transport Protocol), the Web Server does not maintain contact with the user once a page is requested and served. Which means it is extremely difficult to execute an application that requires more than a single response page, or in which you need to maintain your place in a database. IntraBuilder supports "states" - continuous connections  "owned" by a specific user. IntraBuilder also supplies powerful WYSIWYG drag-and-drop form creation, which is far beyond the scope of these Wizards


Images

The Visual dBASE 7 Web Wizards support a wide variety of graphic types, including animated GIFs.

However, the most common Web graphic formats are .GIF and .JPG.

You may use any of the images shipped with the Wizards freely.

Warning: The Browser Palette and the Visual dBASE Palette use different methods of reconciling palettes when displaying 256 color images. To get the best idea of what your colors, backgrounds and images will look like on the Browser, you should set your Windows Display for 65,000 colors or higher. Otherwise, colors and images may appear distorted when working in the Web Wizards.


Reports

The Visual dBASE Web Wizards use Visual dBASE 7 report classes (.rep files) in the Query and Response Wizard and the Publish Wizard. The fact that these reports will be run remotely and automatically presents certain challenges

SQL Select Statements with Queries.

Reports used with the Query and Response Report Wizard must have special SQL Select statements in order to respond to the search criteria typed in or selected by your users.

The Visual dBASE 7 Query Web Wizard creates a public variable "cSearch" at runtime in which it stores the query request typed into the Browser by your user.Therefore, reports that respond to queries need a SQL statement along the lines of:

Query1.SQL = 'Select * from "c:/Orders/Customer.dbf" WHERE Customer."CustName" = ' + '"'+cSearch+"'"

You are responsible for the output and formatting of all reports used with the Web Wizards. The Visual dBASE 7 Web Wizards will not alter your reports in any way.

Reusing Existing Reports.

It is probably advisable to create new reports from scratch for use in the Web Wizards. Reports created for use in applications may have dependencies including (among others) relative paths, parameters, shared queries or global variables. These may present problems to your server-side application since the report will be run from the server's CGI-Bin folder and the CGI application knows nothing about any dependencies you may have designed into your application.

Using Paths in Reports.

Your Visual dBASE Web application will most likely be addressing tables located in some folder other than the one in which it's running. To ensure that the server-side executable application can find your data, make sure you include paths to all databases and tables when creating your Data Modules and Queries.

Superclasses in Reports.

The Visual dBASE Web Wizards will respect a single level of superclass for reports. If your report is based on more than one parent report class, it will not be rendered properly and may crash your server-side CGI application.

Report Layout.

The Browser's window has entirely different metrics from your printer, which can result in unexpected and unaesthetic results when your report is rendered as HTML. It is recommended that you try outputting your report as HTML from Visual dBASE 7 and testing it in the Browser before including it in a WebWizard application.

Report Length.

Design your queries carefully. Performance on a Browser over the wire is very different from performance to a text file, window or printer. In fact, each Browser its own unique limitation on data. Currently, the Visual dBASE 7 Report Wizards generates each report as a single HTML page. If your report yields too many records, it could, conceivably, generate a browser error instead of a page of query results. Keep your queries limited to the number of rows that can be comfortably accomodated by a single HTML page.

Data Modules in Reports.

Your Web application will run from within your CGI-Bin folder, not the native folder in which the report or Data Module was created. In order to ensure that the Data Module (or Query) will be opened successfully, you should include full file paths to all tables or databases.

The Visual dBASE 7 Web Wizards do not currently support subclassed data modules.


System Requirements

Server

You must have a 32-bit Server running on Windows NT or Windows 95 in order to run applications generated by the Visual dBASE 7 Web Wizards. The Web Server must support CGI-Bin

Operating System

A 32-bit Windows operating system is required.

Visual dBASE 7

You do not have to have Visual dBASE 7 installed on your Web Server. However, you must have the Visual dBASE 7 runtime and the Borland Database Engine installed on your Web Server.

Deployment

Your application may run faster if you do a full deployment into your server's CGI folder. Having the runtime in the same place as the executable means that Windows has to do less searching to find components.

Performance

You may improve the server-side performance of your Web application by pre-loading a dummy Visual dBASE 7 executable program, since VdB applications load faster when the runtime and the BDE are already in memory.


The Data Entry Wizard

TheData Entry Web Wizard

The Data-Entry Web Wizard helps you build information-gathering sites.

It automatically generates a data-gathering HTML page that's posted to your Web Site and called from your Home Page or any other page you designate.

In addition, it creates an executable (.EXE) Visual dBASE 7 application that's called from your HTML page using CGI-BIN.

If the program executes properly and the data is entered, a Response page (which you can design) is returned to the Browser.

If the program encounters any problem while executing, it returns an Error page to the Browser.

How is the Data-Entry Application Built?

The application is built in the Wizard from a table or data module you specify. The Wizard walks you through the selection of fields, field order, labels (to display next to the entry controls), text, logo, mail and homepage links.

When you click "Finish", the Visual dBASE Data-Entry Wizard will generate:

An HTML starting page in a folder on your Web site. (X.htm)

A Modifiable source code file in your CGI-Bin folder. (X.prg)

An Executable file in your CGI-Bin folder (X2.EXE)

A Batch file to trap output back to the Browser in your CGI-Bin folder (X.BAT)

Caution: This application will run from your Web Site and your CGI-Bin folder. Make absolutely sure that any tables referenced in a SQL Select statement has a full file path. The lack of a path can cause your Web application to crash.

This Wizard is useful for:

Gathering Names and Address information (Demographics)

Remote Data-entry (Salespersons in the field)

Taking Orders


The Publish Web Wizard

The Visual dBASE & Publish Web Wizard helps you create applications that will display Visual dBASE 7 reports (.rep) on the Browser.

Static Reports

Static reports are run from within the Wizard. The resultant HTML output is saved in a folder on your Web site. To access the report, just put an Href (link) to the generated page in any other page on your site. Static reports remain the same until you run the Wizard again.

Live Reports

Live reports are generated at runtime using a CGI executable application on your Web Server. Unlike static reports, these reports are as up-to-date as the moment they're run.

Advantages and Disadvantages

Static reports yield very high Browser performance. No application needs to be run, no data generated.

However, they maybe inappropriate on a site where live data is required or where data changes rapidly.

Live reports always show the most current data. If you're posting a price list and you have daily or hourly changes, a live report is undoubtedly preferable. If, however, your price list changes only once a month or once a quarter, you can save traffic on your site by using static reports.

For static reports, the Visual dBASE 7 Publish Wizard generates only a single HTML file in a folder on your Web site.

For live reports, the Visual dBASE 7 Publish Wizard generates:

1. A modifiable .prg source code file in your CGI-Bin folder

2. An executable (.EXE) file in your CGI-Bin folder

3. A batch file (.BAT) for CGI responses in your CGI-Bin folder

There is no calling page for the Publish Wizard. You call the wizard by embedding a link in one of your own Web site HTML pages. An example of the URL you'll need to use:

http://www.mydomain.com/cgi-bin/myreport.bat

When you click "finish" on the last page of the WIzard, you will be given a list of the paths and files used and created in generating your application.


The Query and Response Web Wizard

The Visual dBASE 7 Query and Response Web Wizard helps you develop a Web application wherein your user may enter or select a search criteria and obtain a listing of the results in the Browser.

This Wizard supports two-level drill-down reports. For example, you might let the user select "category" from the first query page. Then click on any item in the resultant report to get descriptions and prices.

The drill-down capability is provided by two separate report files running from within two separate server-side executable programs.Each one streams a Visual dBASE 7 report back to the user.

Query Input

The Visual dBASE Query and Response Wizard provides two options for gathering search criteria from the user:

1. An HTML Text object (similar to an Entryfield) in which the user can type his or her search criteria.

2. An HTML Select object (similar to a Combobox) in which the user may click on one of your pre-defined search strings.

The Wizard generates:

A customized HTML query page in your specified Web Site folder.

A modifiable .PRG for each level of query in your CGI-Bin folder.

One executable (.EXE) for each level of query in your CGI-Bin folder

Two Batch (.BAT) files to stream CGI reponses back to the Browser, also in your CGI-Bin folder.

Reponse Reports

The Query and Response Wizard gathers the query typed or selected by your user and stores it in a public variable (cSearch) for use in your query's SQL statement. For more information on setting up the SQL statement, see Reports.  You are responsible for designing your SQL statements to respond appropriately to the user's search criteria.

This WIzard is use for creating:

1. Inventory Lists

2. Price Lists

3. Customer Lists

4. Remote Data Lookup of any kind.


URLs and Folders

All of the Visual dBASE 7 Web Wizards will ask you for location information. It is important that you distinguish between folders and addresses or your application components may end up in the wrong place.

URL

When asked for a URL, give the full address required to access the page or application. The URL is not a folder - it's the fully-qualified domain name and virtual server paths. For example:

http://borland.com/cgi-bin/

represents a CGI URL

However, the WIndows Folder for the same location might be:

c:\MyWeb\Server\CGI-shl\

Check the labels on the WIzard carefully to make sure you're typing a URL when needed and not a folder.

Folders

In order to deploy the generated files to the right location on your hard disk, the Web WIzards often ask for Windows Folders. When it does, you need to type in or select the actual Windows path:

c:\Mysite\Cgi\

Be careful that you don't type in "relative" or "virtual" addresses when a folder is requested.

Please note. URLs use the slash ( / ) as a separator, Folders use backslash ( \ )


What Are The Visual dBASE 7 Web Wizards
What Are The Visual dBASE 7 Web Wizards?

The Visual dBASE 7 Web Wizards are a suite of three programs that help you write Web applications using the powerful new capabilities of Visual dBASE 7. The Wizards walk you, step-by-step, through the process of selecting the data, folders and design elements you'll need to create highly interactive Web applications. When you click "finish", the Wizards automatically generate the source code, HTML pages and compiled .EXEs required to complete your project. The only items you need to provide outside of the Wizards are tables, reports or Data Modules that are to be included in your final application.

Web applications provide significant benefits to the programmer and the enterprise:

Multi-Platform

Your Web application executes on the server. However, data entry and data display happen on the Browser. Which means that a user can access your application regardless of platform. Users using MacIntosh, Unix, Intel, Windows, DOS, XWindows, AS/400 or any other hardware platform that provides a Browser and a TCP/IP connection can enter data into your Visual dBASE 7 tables, execute queries and view live data reports.

Thin-Client.

Visual dBASE 7 and  32-bit operating systems demand more substantial resources than previous versions. Not all installed computers provide sufficient resources to access your Visual dBASE 7 applications with adequate performance. By using a Browser interface to your Visual dBASE data, you extend the reach of your applications to older and less robust hardware. As an added benefit, users of 16-bit operating systems (such as Windows 3.X) will be able to access your data as well.

The Web applications generated by these Wizards can be used on either an Intranet, the Internet, or even a stand-alone computer as long as your installation meets certain basic requirements::

Remote Access

TCP/IP and the World Wide Web have made the Wide-Area Network affordable and simple. Your employees, customers and contacts can access your data from remote locations for the cost of a local phone call.

Requirements

1. Web Wizard applications run only on 32-bit Windows servers including Windows 95 and Windows NT.

2. You must have Web Server software installed that supports the Win-CGI protocol. Servers such as O'Reilly's WebSite, Microsoft's Internet Information Server and Netscape FastTrack all support Win-CGI.

3. You must install the Borland Database Engine and the Visual dBASE 7 Runtime on the same server that will run your Web applications.

What The Wizards Do

There are three Visual dBASE 7 Web Wizards:

The Data-Entry Web WIzard helps you create an application in which a remote user can enter data into your tables using a Browser.Typical uses might be:

Salespersons reporting from the field.

Order Gathering

Name and Address Gathering

Help Desk

The Query and Response Web Wizard helps you create an application wherein the user enters or selects criteria from a Web Page and receives a report in response. The Visual dBASE 7 Web Wizards support a drill-down query - the user may refine his or her query by selecting an item on the first report, which "drills down" into detail in a second report. Typical uses might be:

Customer Account queries

Inventory queries

Product Line queries.

The Publish Web Wizard helps you post static and live Visual dBASE 7 reports on your Web site. Static reports are run at the time you run the Wizard. An HTML page is generated on your Web site that does not change until you run the Wizard again. Live reports are run on your Web Server each time the user accesses the report, returning live, up-to-the-minute data to the Browser. Typical users might be:

Price Lists

Product Lists

Customer Lists